Group the UI into 4 sections + add an Overview stats dashboard - #41
Merged
Conversation
Replace the 11-item flat top bar with Overview / Serving / Observe / Admin / Playground, each revealing sub-tabs. Hash routing (#/section/tab) makes sub-tabs deep-linkable and reload-safe. Services splits into routes/profiles sub-tabs via a mode prop. All existing views re-homed unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Overview is now read-only monitoring (header summary + GPU health strip), with a placeholder for the Phase 4 request-stat tiles. The load/stop/pin control table moves to Serving>Deployments. GpuCard and Sparkline are promoted to components/ for reuse; the old Dashboard.tsx and cluster/Sparkline.tsx are retired. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add usage_events.series_in_window() — bucketed request volume + tokens over a window, zero-filled and oldest-first, optionally grouped by model or key (mirrors key_usage.bucketed_usage). Expose it as GET /admin/usage/series on the admin router to power the Overview dashboard's volume/throughput tiles and traffic-over-time/top-models history. Bounded by usage retention. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add the stats dashboard to Overview: four StatTiles (volume, latency, errors, throughput) with latency/errors badged "live · 60s"; volume and throughput sourced from /admin/usage/series recent buckets, latency/errors from the metrics snapshot via a request-weighted aggregateSnapshot helper. Plus a 24h traffic-over-time bar chart and top-models table from usage history, and a read-only deployments glance linking to Serving. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
series_in_window interpolated the group-by column into an f-string query, which Bandit flagged as a possible SQL-injection vector (B608) and failed the Security CI job. The column was always an internal whitelist value, not user input, but switch to fully literal per-branch queries so there is no string-built SQL at all. Behavior unchanged; tests still green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The frontend had 11 flat, equal-weight nav pages and no real request-stats view. This regroups the UI by task and adds a proper Overview dashboard.
nav.tsconfig drives the shell, and hash routing (#/section/tab) makes sub-tabs deep-linkable and reload-safe. Services splits into routes/profiles sub-tabs.dashboardinto read-only monitoring (here) and the load/stop/pin control table (moved to Serving › Deployments). Overview shows GPU health plus four request-stat tiles — volume, latency, errors, throughput. Latency/errors are a rolling ~60s window and are badgedlive · 60s; volume/throughput plus a 24h traffic chart and top-models come from real history.GET /admin/usage/series(bucketed request volume + tokens over a window, optionalgroup_by=model|key) over the existingusage_eventstable. No schema change, no new storage; bounded by usage retention.Deferred (separate spec): persisting latency/errors so they trend over days. Until then those two tiles are live-only, which the UI states explicitly.
Design + plan:
docs/superpowers/specs/2026-06-05-ui-ia-redesign-and-overview-dashboard-design.md(local, gitignored).Test Plan
series_in_windowstore +/admin/usage/seriesHTTP via the app fixture).ruff+mypyclean.tsc -b+vite buildgreen (repo has no UI test framework)./admin/usage/seriesreturns correct buckets/groups; the Overview renders all tiles with data; nav sections, sub-tabs, and deep-links work; zero browser console errors.🤖 Generated with Claude Code